package Q1;

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int n = scanner.nextInt();
        long x = scanner.nextLong();
        int[] arr = new int[n];

        for (int i = 0; i < n; i++) {
            arr[i] = scanner.nextInt();
            if (x >= arr[i]) {
                x += arr[i];
            } else {
                x += method(arr[i], (int)x);
            }
        }

        System.out.println(x);
    }

    /**
     * 求两数的最大公约数
     * @param a
     * @param b
     * @return
     */
    public static int method(int a, int b) {
        int c = a % b;
        while (c > 0) {
            a = b;
            b = c;
            c = a % b;
        }

        return b;
    }
}
